using JT808Protocol.Models.Enums;
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace JT808Protocol.Models.BodyParserStrategy.DeviceParams
{
    /// <summary>
    /// 违规行驶时段范围，精确到分，时分 --> 时分
    /// </summary>
    public class DpDeregulationTime_0x32 : IDeviceParam
    {
        public EnumDeviceParamType ParamType
        {
            get
            {
                try
                {
                    return (EnumDeviceParamType)ParamID;
                }
                catch (Exception)
                {
                    return EnumDeviceParamType.保留;
                }
            }
        }

        /// <summary>
        /// 起始时间，24小时制，只取小时和分钟
        /// </summary>
        [JsonPropertyName("起始时间")] public DateTime StartTime { get; set; }

        /// <summary>
        /// 结束时间，只取小时和分钟
        /// </summary>
        [JsonPropertyName("结束时间")] public DateTime EndTime { get; set; }

        public byte Length => 4 + 5;

        public uint ParamID => 0x32;

        public void ReadEntity(ref ReadOnlySpan<byte> source, ref int startIndex)
        {
            throw new NotImplementedException();
        }

        public List<byte> WriteToNetBytes()
        {
            throw new NotImplementedException();
        }
    }
}